<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>flex布局</title>
    <style>
        div{
            height: 900px;
            background-color: orange;
            /*开启弹性布局.flex弹性布局必须添加在父元素上.*/
            display: flex;

            /*控制容器内的内容横向居中.*/
            justify-content: center;
            /*控制容器内的内容纵向居中.*/
            align-items: center;
        }
        section{
            width: 300px;
            height: 300px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div>
        <section>
            这是一个section.
        </section>
    </div>
</body>
</html>